
import sys
import os

sys.path.append("/home/bowtie/Bowtie_Illumina_Alignment/scripts")

import sampleInfoInterface
import generatePooledBowtieMapping

if __name__=="__main__":
    sample = sys.argv[1]
    goodLanesOnly = True
    logFile = None
    targets = sampleInfoInterface.SampleInfo(sample).getGoodLanes()
    if len(targets) == 0:
        goodLanesOnly = False
        targets = sampleInfoInterface.SampleInfo(sample).getAllLanes()
        print >> sys.stderr, "# No good lanes... falling back to all lanes."
    print >> sys.stderr, "# Targets =", targets
    if len(targets) == 0:
        print >> sys.stderr, "# Exiting early, no targets found."
        sys.exit(0)
    generatePooledBowtieMapping.generatePooledBowtieMapping(targets, logFile, goodLanesOnly)
